package niuke.week4;

import java.util.Scanner;

/**
 */
public class ELuoSIArr {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();

        int [] c = new int[n];

        for (int i = 0; i < m; i++) {
            int idx = sc.nextInt();
            c[idx-1] +=  1;
        }
        int res =  c[0];
        for (int i : c) {
            res = Math.min(i,res);
        }
        System.out.println(res);
    }
}